﻿<telerik:RadWindow x:Class="ProTemplate.UserControls.RadWindows.AddUserGroup"
    xmlns:my="clr-namespace:ProTemplate.UserControls"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
    xmlns:controls="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls" Closed="RadWindow_Closed"
    mc:Ignorable="d" Header="新增用户组" Style="{StaticResource CommonRadWindowStyle}" Width="400" Height="300"
    d:DesignHeight="300" d:DesignWidth="400" telerik:Theming.Theme="Office_Blue" WindowStartupLocation="CenterScreen">
    
    <Grid x:Name="LayoutRoot" Background="White">
        <Grid.RowDefinitions>
            <RowDefinition Height="40" />
            <RowDefinition Height="*" />
            <RowDefinition Height="30" />
        </Grid.RowDefinitions>
        <my:EditWindowToolBar x:Name="toolBar" Grid.Row="0" SaveAndClose="EditWindowToolBar_SaveAndClose" SaveAndNew="EditWindowToolBar_SaveAndNew" Close="EditWindowToolBar_Close"/>
        <telerik:RadTabControl Grid.Row="1" telerik:Theming.Theme="Office_Blue">
            <telerik:RadTabItem Header="基本信息">
                <Grid>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="100" />
                        <ColumnDefinition Width="*" />
                    </Grid.ColumnDefinitions>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="30" />
                        <RowDefinition Height="*" />
                    </Grid.RowDefinitions>
                    <TextBlock Grid.Row="0" Text="用户组名:" Style="{StaticResource WindowInputLabel}"  />
                    <TextBox Grid.Row="0" Grid.Column="1" MaxLength="20" Name="tbName" Style="{StaticResource WindowInput}" Text="{Binding Name, Mode=TwoWay, ValidatesOnExceptions=True, NotifyOnValidationError=True, UpdateSourceTrigger=Explicit}" />
                </Grid>
            </telerik:RadTabItem>
            <telerik:RadTabItem Header="客户">
                <Grid Background="AliceBlue">
                    <Grid.RowDefinitions>
                        <RowDefinition Height="20" />
                        <RowDefinition Height="*" />
                    </Grid.RowDefinitions>
                    <CheckBox x:Name="cbAll" IsChecked="False" Content="All" VerticalAlignment="Center" Margin="5,0" Checked="CheckBox_Checked" Unchecked="CheckBox_Unchecked" />
                    <ListBox x:Name="lstCustomers" ItemsSource="{Binding Items, Source={StaticResource CustomerViewModel}}" Grid.Row="1">
                        <ListBox.ItemTemplate>
                            <DataTemplate>
                                <CheckBox Content="{Binding Name}" Tag="{Binding ID}" IsChecked="{Binding IsSelected, Mode=TwoWay}"></CheckBox>
                            </DataTemplate>
                        </ListBox.ItemTemplate>
                    </ListBox>
                </Grid>
            </telerik:RadTabItem>
        </telerik:RadTabControl>

        <Border x:Name="bdMsgParent" Grid.Row="2" Grid.ColumnSpan="2" HorizontalAlignment="Right" Margin="0,8,10,0"></Border>

        <Border Grid.RowSpan="3">
            <telerik:RadBusyIndicator x:Name="busyIndicator" DisplayAfter="0" IsBusy="False" BusyContent="正在处理，请稍候..." />
        </Border>
    </Grid>
</telerik:RadWindow>
